<?php
// +----------------------------------------------------------------------
// | OneKeyAdmin [ Believe that you can do better ]
// +----------------------------------------------------------------------
// | Copyright (c) 2020-2023 http://onekeyadmin.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: MUKE <513038996@qq.com>
// +----------------------------------------------------------------------
namespace app\admin\validate;

use think\Validate;

class Catalog extends Validate
{
    protected $rule =   [
        'title'      => 'require',
        'pid'        => 'require|number',
        'type'       => 'require',
        'show'       => 'require|number',
    ];
    protected $message  =   [
        'title.require' => '请输入标题',
        'pid.require'   => '请选择父级id',
        'pid.number'    => '父级id类型错误',
        'type.require'  => '请选择分类类型',
        'type.number'   => '分类类型错误',
        'show.require'  => '请选择显示方式',
    ];
    protected $scene = [
        'save'       => ['title','pid','type','show'],
        'update'     => ['title','pid','type','show'],
    ];
}